#ifndef _GWEATHER_H
#define _GWEATHER_H

#include <libxml/SAX.h>
#include <stdbool.h>
#include "dwmstatus_types.h"

#define UNAVAILABLE "Unavailable"
#define CURRENT_CONDITIONS_NODE "current_conditions"
#define PROBLEM_CAUSED_NODE "problem_cause"
#define CONDITION_NODE "condition"
#define DATA_ATTRIBUTE "data"

struct weather {
  String condition;
  String temperature;
  bool in_current_condition;
  bool failed;
};
typedef struct weather Weather;

void set_gweather(char *);
void get_gweather(char*, size_t);
void gweather_start();
void gweather_format_weather(Weather *);
void gweather_update_weather();
void *gweather_loop(void *ptr);
void gweather_sax_on_start(void *, const xmlChar *, const xmlChar *, const xmlChar *, const int, const xmlChar **, int, int, const xmlChar **);
void gweather_sax_on_end(void *, const xmlChar*, const xmlChar*, const xmlChar *);
void gweather_set_sax_handler(xmlSAXHandler *);


#endif
